/******************************************************************
 *
 *    tenant, Powered By uyun.cn.
 *
 *    Copyright (c) 2001-2020
 *    https://uyun.cn
 *
 *    Package:     wzg.com
 *
 *    Filename:    RunThread1
 *
 *    Description: (用一句话描述该文件做什么)
 *
 *    Copyright:   Copyright (c) 2001-2020
 *
 *    Company:     uyun.cn
 *
 *    @author: 王志刚
 *
 *    @version: 1.0.0
 *
 *    Create at:   2018-01-03 下午8:01
 *
 *    Revision:
 *
 *    2018-01-03 下午8:01
 *        - first revision
 *
 *****************************************************************/
package wzg.com;

/**
 * RunThread1(这里用一句话描述这个类的作用)
 *
 * @author wangzg
 * @version 1.0.0
 * @create 2018-01-03 下午8:01
 */
public class RunThread1 {
    private  boolean isRunning = true;
    private void setRunning(boolean isRunning){
        this.isRunning = isRunning;
    }
    public void run1(){
        while(isRunning == true){
        }
        System.out.println("t1我退出了");
    }
    public static void main(String[] args) throws InterruptedException {
        final RunThread1 rt = new RunThread1();
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                rt.run1();
            }
        });
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                rt.setRunning(false);
                while(true){

                }
            }
        });
        t.start();
        t2.start();
    }
}
